package com.lagou.edu.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


//@Configuration
//@EnableConfigurationProperties

@Component
@PropertySource("classpath:test.properties")
@ConfigurationProperties("test1")
public class MyProperties1 {
    @Value("${test1.id}")
    private int id;
    @Value("${test1.name}")
    private String name;

    @Override
    public String toString() {
        return "MyProperties1{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
